// 获取鼠标点击
import { ref, onMounted, onUnmounted } from 'vue';
function useMousePosition() {
  let event = ref({});
  const updateMouse = (e) => {
    event.value = e;
  };
  onMounted(() => {
    document.addEventListener('click', updateMouse);
  });
  onUnmounted(() => {
    document.removeEventListener('click', updateMouse);
  });
  return event;
}

export { useMousePosition };
